-- GENERATED SPELL FOR [Melgromm Highmountain] --


function spell0_18969(pUnit, Event) --@Chain Heal,Heal--
pUnit:FullCastSpellOnTarget(33642,pUnit)
pUnit:RegisterEvent('Sorts_18969', 2500, 1)
end

function spell1_18969(pUnit, Event) --@Chain Lightning,n/a--
pUnit:FullCastSpellOnTarget(33643,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18969', 3000, 1)
end

function spell2_18969(pUnit, Event) --@Earth Shock,n/a--
pUnit:FullCastSpellOnTarget(22885,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18969', 2316, 1)
end

function spell3_18969(pUnit, Event) --@Magma Flow Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(33560,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_18969', 1, 1)
end

function spell4_18969(pUnit, Event) --@Revive Self,n/a--
pUnit:FullCastSpellOnTarget(32343,pUnit:GetMainTank ())
pUnit:RegisterEvent('Sorts_18969', 613, 1)
end

function spell5_18969(pUnit, Event) --@Strength of the Storm Totem,Self--
pUnit:FullCastSpellOnTarget(33570,pUnit)
pUnit:RegisterEvent('Sorts_18969', 602, 1)
end

function Sorts_18969(pUnit, Event)
local choix_sorts_18969 = math.random(0, 5)
if choix_sorts_18969 == 0 then
pUnit:RegisterEvent('spell0_18969', 1, 1)
end
if choix_sorts_18969 == 1 then
pUnit:RegisterEvent('spell1_18969', 1, 1)
end
if choix_sorts_18969 == 2 then
pUnit:RegisterEvent('spell2_18969', 1, 1)
end
if choix_sorts_18969 == 3 then
pUnit:RegisterEvent('spell3_18969', 1, 1)
end
if choix_sorts_18969 == 4 then
pUnit:RegisterEvent('spell4_18969', 1, 1)
end
if choix_sorts_18969 == 5 then
pUnit:RegisterEvent('spell5_18969', 1, 1)
end
end

function mob18969_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_18969', math.random(1500, 3000), 1)
end

function mob18969_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18969_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob18969_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(18969, 1, 'mob18969_Action')
RegisterUnitEvent(18969, 2, 'mob18969_Leave')
RegisterUnitEvent(18969, 3, 'mob18969_Kill')
RegisterUnitEvent(18969, 4, 'mob18969_Die')
